<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Template • TodoMVC</title>
		<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
		<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
		<!-- CSS overrides - remove if you don't need it -->
		<link rel="stylesheet" href="css/app.css">
		
	</head>
	<body>
		<!--功能介绍 
			1.列表渲染
			2.添加任务
			3.删除单个任务
			4.全选/全不选
			5.删除所有完成的
			6.显示所有未完成的数量
		 -->
		<!-- 选择节点 el:"#todoapp" -->
		<section class="todoapp" id="todoapp">
			<header class="header">
				<h1>todos</h1>
				<!-- 2.  绑定事件 键盘弹起 handleAddToDo-->
				<input v-on:keyup.enter="handleAddToDo" class="new-todo" placeholder="What needs to be done?" autofocus>
			</header>
			<!-- This section should be hidden by default and shown when there are todos -->
			<section class="main">
				<!-- 添加事件 全选/全不选  handleToggleAll --> 
				<!--动态绑定一般绑定数据 现在绑定一个函数的调用 getToggleAllStatus() 函数的返回值-->
				<input id="toggle-all" v-bind:checked="getToggleAllStatus()" @click="handleToggleAll" class="toggle-all" type="checkbox">
				<label for="toggle-all">Mark all as complete</label>
				<ul class="todo-list">
					<!-- These are here just to show the structure of the list items -->
					<!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
					<!-- 任务列表状态样式
						已完成 completed 样式
						未完成 空 样式
						编辑状态 editing 样式
					 -->
					<!-- 1. <li class="completed"> 任务列表渲染 1循环列表数据 2动态绑定数据修改样式 v-bind:class="{类名:item.done}" --> 
					<li v-bind:class="{completed:item.done}" v-for="(item,index) in todos">
						<div class="view">
							<!-- <input class="toggle" type="checkbox" checked> 使用双向数据绑定v-model="item.done"-->
							<!-- 添加事件 @click="getToggleAllStatus" -->
							<input class="toggle" @click="getToggleAllStatus" type="checkbox" v-model="item.done">
							<label>{{item.title}}</label>
							<!-- 3.  绑定事件 点击 handleRemovetodo-->
							<button v-on:click="handleRemovetodo(index)" class="destroy"></button>
						</div>
						<input class="edit" value="Create a TodoMVC template">
					</li>
					
				</ul>
			</section>
			<!-- This footer should hidden by default and shown when there are todos -->
			<footer class="footer">
				<!-- This should be `0 items left` by default -->
				<!-- <span class="todo-count"><strong>0</strong> item left</span> -->
				<!-- 换成计算属性 -->
				<!-- <span class="todo-count"><strong>{{getRemaining()}}</strong> 项未完成</span> -->
				<span class="todo-count"><strong>{{getRemaining}}</strong> 项未完成</span>
				<!-- Remove this if you don't implement routing -->
				<ul class="filters">
					<li>
						<a class="selected" href="#/">All</a>
					</li>
					<li>
						<a href="#/active">Active</a>
					</li>
					<li>
						<a href="#/completed">Completed</a>
					</li>
				</ul>
				<!-- Hidden if no completed items are left ↓ -->
				
				<button class="clear-completed" @click="handleClearAllDone">删除完成任务</button>
			</footer>
		</section>
		<footer class="info">
			<p>Double-click to edit a todo</p>
			<!-- Remove the below line ↓ -->
			<p>Template by <a href="http://sindresorhus.com">Sindre Sorhus</a></p>
			<!-- Change this out with your name and url ↓ -->
			<p>Created by <a href="http://todomvc.com">you</a></p>
			<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
		</footer>
		<!-- Scripts here. Don't remove ↓ -->
		<!-- <script src="node_modules/todomvc-common/base.js"></script> -->
		<script src="./node_modules/vue/dist/vue.js"></script>
		<script src="js/app.js"></script>
	</body>
</html>
